#ifndef SWP_ENTITY_GRAPHIC_ITEM_H
#define SWP_ENTITY_GRAPHIC_ITEM_H

#include "abstractpolygongraphicitem.h"

namespace swp
{

class SwpEntityGraphicItem : public AbstractPolygonGraphicItem
{
public:
    SwpEntityGraphicItem(const QString& entityName, const QString& entityType,
        QGraphicsItem* parent = 0);
    ~SwpEntityGraphicItem();

    void setEntityName(const QString& name);
    QString entityName() const;

    // IEditorItem
    bool supportsConnection(
        const core::ConnectionData& connection) const;

    // IPropertyObject
    QList<core::Property> properties() const;

    QVariant propertyValue(const QString& propertyName) const;

    void propertyChanged(const QString& property,
        const QVariant& newValue, bool silent = false);

    QVariantList optionList(const QString& propertyName) const;
    QVariantList autocomplete(const QString& propertyName) const;

protected:
    // AbstractPolygonGraphicItem
    QList<QPointF> scalePoints() const;
    QList<QPointF> connectPoints() const;
    QList<QPointF> selfConnectAnchorPoints() const;

private:
    bool containsSameConnection(const core::ConnectionData& connection) const;

protected:
    QString m_entityName;
    core::Property m_entityNameProp;
};

} // namespace swp

#endif
